home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / PInterfaces / GXEnvironment.p < prev    next >
Encoding:
Text File  |  1996-09-22  |  7.3 KB  |  219 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        GXEnvironment.p
  3.  
  4.      Contains:    QuickDraw GX environment constants and interfaces
  5.  
  6.      Version:    Technology:    Quickdraw GX 1.1
  7.                  Release:    Universal Interfaces 2.1.4
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT GXEnvironment;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __GXENVIRONMENT__}
  28. {$SETC __GXENVIRONMENT__ := 1}
  29.  
  30. {$I+}
  31. {$SETC GXEnvironmentIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __CONDITIONALMACROS__}
  35. {$I ConditionalMacros.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __MIXEDMODE__}
  38. {$I MixedMode.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __WINDOWS__}
  41. {$I Windows.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __GXTYPES__}
  44. {$I GXTypes.p}
  45. {$ENDC}
  46. {$IFC UNDEFINED __CMAPPLICATION__}
  47. {$I CMApplication.p}
  48. {$ENDC}
  49.  
  50. {$PUSH}
  51. {$ALIGN MAC68K}
  52. {$LibExport+}
  53.  
  54. CONST
  55.     defaultPollingHandlerFlags    = $00;
  56.     okToSwitchDuringPollFlag    = $00;
  57.     dontSwitchDuringPollFlag    = $01;
  58.  
  59.  
  60. TYPE
  61.     gxPollingHandlerFlags                = LONGINT;
  62.     gxPollingHandlerProcPtr = ProcPtr;  { PROCEDURE gxPollingHandler(reference: LONGINT; flags: gxPollingHandlerFlags); C; }
  63.  
  64.     gxPollingHandlerUPP = UniversalProcPtr;
  65.  
  66. CONST
  67.     uppgxPollingHandlerProcInfo = $000003C1;
  68.  
  69. FUNCTION NewgxPollingHandlerProc(userRoutine: gxPollingHandlerProcPtr): gxPollingHandlerUPP;
  70.     {$IFC NOT GENERATINGCFM }
  71.     INLINE $2E9F;
  72.     {$ENDC}
  73.  
  74. PROCEDURE CallgxPollingHandlerProc(reference: LONGINT; flags: gxPollingHandlerFlags; userRoutine: gxPollingHandlerUPP);
  75.     {$IFC NOT GENERATINGCFM}
  76.     {To be implemented:  Glue to move parameters into registers.}
  77.     {$ENDC}
  78. FUNCTION GXGetGraphicsPollingHandler(VAR reference: LONGINT): gxPollingHandlerUPP; C;
  79. PROCEDURE GXSetGraphicsPollingHandler(handler: gxPollingHandlerUPP; reference: LONGINT); C;
  80. {  QD to QD GX Translator typedefs  }
  81.  
  82. CONST
  83.     gxDefaultOptionsTranslation    = $0000;
  84.     gxOptimizedTranslation        = $0001;
  85.     gxReplaceLineWidthTranslation = $0002;
  86.     gxSimpleScalingTranslation    = $0004;
  87.     gxSimpleGeometryTranslation    = $0008;                        {  implies simple scaling  }
  88.     gxSimpleLinesTranslation    = $000C;                        {  implies simple geometry & scaling  }
  89.     gxLayoutTextTranslation        = $0010;                        {  turn on gxLine layout (normally off)  }
  90.     gxRasterTargetTranslation    = $0020;
  91.     gxPostScriptTargetTranslation = $0040;
  92.     gxVectorTargetTranslation    = $0080;
  93.     gxPDDTargetTranslation        = $0100;
  94.     gxDontConvertPatternsTranslation = $1000;
  95.     gxDontSplitBitmapsTranslation = $2000;
  96.  
  97.  
  98. TYPE
  99.     gxTranslationOption                    = LONGINT;
  100.  
  101. CONST
  102.     gxContainsFormsBegin        = $0001;
  103.     gxContainsFormsEnd            = $0002;
  104.     gxContainsPostScript        = $0004;
  105.     gxContainsEmptyPostScript    = $0008;
  106.  
  107.  
  108. TYPE
  109.     gxTranslationStatistic                = LONGINT;
  110.  
  111. CONST
  112.     gxQuickDrawPictTag            = 'pict';
  113.  
  114.  
  115. TYPE
  116.     gxQuickDrawPictPtr = ^gxQuickDrawPict;
  117.     gxQuickDrawPict = RECORD
  118.                                                                         {  translator inputs  }
  119.         options:                gxTranslationOption;
  120.         srcRect:                Rect;
  121.         styleStretch:            Point;
  122.                                                                         {  size of quickdraw picture data  }
  123.         dataLength:                LONGINT;
  124.                                                                         {  file alias  }
  125.         alias:                    gxBitmapDataSourceAlias;
  126.     END;
  127.  
  128. {  WindowRecord utilities  }
  129. FUNCTION GXNewWindowViewPort(qdWindow: WindowRef): gxViewPort; C;
  130. FUNCTION GXGetWindowViewPort(qdWindow: WindowRef): gxViewPort; C;
  131. FUNCTION GXGetViewPortWindow(portOrder: gxViewPort): WindowRef; C;
  132. {  GDevice utilities  }
  133. FUNCTION GXGetViewDeviceGDevice(theDevice: gxViewDevice): GDHandle; C;
  134. FUNCTION GXGetGDeviceViewDevice(qdGDevice: GDHandle): gxViewDevice; C;
  135. {  gxPoint utilities  }
  136. PROCEDURE GXConvertQDPoint({CONST}VAR shortPt: Point; portOrder: gxViewPort; VAR fixedPt: gxPoint); C;
  137.  
  138. TYPE
  139.     gxShapeSpoolProcPtr = ProcPtr;  { FUNCTION gxShapeSpool(toSpool: gxShape; refCon: LONGINT): OSErr; C; }
  140.  
  141. {  printing utilities typedef  }
  142.     gxUserViewPortFilterProcPtr = ProcPtr;  { PROCEDURE gxUserViewPortFilter(toFilter: gxShape; portOrder: gxViewPort; refCon: LONGINT); C; }
  143.  
  144.     gxConvertQDFontProcPtr = ProcPtr;  { FUNCTION gxConvertQDFont(dst: gxStyle; txFont: LONGINT; txFace: LONGINT): LONGINT; C; }
  145.  
  146.     gxShapeSpoolUPP = UniversalProcPtr;
  147.     gxUserViewPortFilterUPP = UniversalProcPtr;
  148.     gxConvertQDFontUPP = UniversalProcPtr;
  149.  
  150. CONST
  151.     uppgxShapeSpoolProcInfo = $000003E1;
  152.     uppgxUserViewPortFilterProcInfo = $00000FC1;
  153.     uppgxConvertQDFontProcInfo = $00000FF1;
  154.  
  155. FUNCTION NewgxShapeSpoolProc(userRoutine: gxShapeSpoolProcPtr): gxShapeSpoolUPP;
  156.     {$IFC NOT GENERATINGCFM }
  157.     INLINE $2E9F;
  158.     {$ENDC}
  159.  
  160. FUNCTION NewgxUserViewPortFilterProc(userRoutine: gxUserViewPortFilterProcPtr): gxUserViewPortFilterUPP;
  161.     {$IFC NOT GENERATINGCFM }
  162.     INLINE $2E9F;
  163.     {$ENDC}
  164.  
  165. FUNCTION NewgxConvertQDFontProc(userRoutine: gxConvertQDFontProcPtr): gxConvertQDFontUPP;
  166.     {$IFC NOT GENERATINGCFM }
  167.     INLINE $2E9F;
  168.     {$ENDC}
  169.  
  170. FUNCTION CallgxShapeSpoolProc(toSpool: gxShape; refCon: LONGINT; userRoutine: gxShapeSpoolUPP): OSErr;
  171.     {$IFC NOT GENERATINGCFM}
  172.     {To be implemented:  Glue to move parameters into registers.}
  173.     {$ENDC}
  174.  
  175. PROCEDURE CallgxUserViewPortFilterProc(toFilter: gxShape; portOrder: gxViewPort; refCon: LONGINT; userRoutine: gxUserViewPortFilterUPP);
  176.     {$IFC NOT GENERATINGCFM}
  177.     {To be implemented:  Glue to move parameters into registers.}
  178.     {$ENDC}
  179.  
  180. FUNCTION CallgxConvertQDFontProc(dst: gxStyle; txFont: LONGINT; txFace: LONGINT; userRoutine: gxConvertQDFontUPP): LONGINT;
  181.     {$IFC NOT GENERATINGCFM}
  182.     {To be implemented:  Glue to move parameters into registers.}
  183.     {$ENDC}
  184.  
  185. TYPE
  186.     gxShapeSpoolFunction                = gxShapeSpoolProcPtr;
  187.     gxUserViewPortFilter                = gxUserViewPortFilterProcPtr;
  188.     gxConvertQDFontFunction                = gxConvertQDFontProcPtr;
  189. {  mouse utilities  }
  190. {  return mouse location in fixed-gxPoint global space  }
  191. PROCEDURE GXGetGlobalMouse(VAR globalPt: gxPoint); C;
  192. {  return fixed-gxPoint local mouse (gxViewPort == 0 --> default)  }
  193. PROCEDURE GXGetViewPortMouse(portOrder: gxViewPort; VAR localPt: gxPoint); C;
  194. {  printing utilities  }
  195. FUNCTION GXGetViewPortFilter(portOrder: gxViewPort; VAR refCon: LONGINT): gxUserViewPortFilterUPP; C;
  196. PROCEDURE GXSetViewPortFilter(portOrder: gxViewPort; filter: gxUserViewPortFilterUPP; refCon: LONGINT); C;
  197. {  QD to QD GX Translator functions  }
  198. PROCEDURE GXInstallQDTranslator(port: GrafPtr; options: gxTranslationOption; {CONST}VAR srcRect: Rect; {CONST}VAR dstRect: Rect; styleStrech: Point; userFunction: gxShapeSpoolUPP; reference: UNIV Ptr); C;
  199. FUNCTION GXRemoveQDTranslator(port: GrafPtr; VAR statistic: gxTranslationStatistic): gxTranslationStatistic; C;
  200. FUNCTION GXConvertPICTToShape(pict: PicHandle; options: gxTranslationOption; {CONST}VAR srcRect: Rect; {CONST}VAR dstRect: Rect; styleStretch: Point; destination: gxShape; VAR stats: gxTranslationStatistic): gxShape; C;
  201. {  Find the best GX style given a QD font and face. Called by the QD->GX translator  }
  202. FUNCTION GXConvertQDFont(theStyle: gxStyle; txFont: LONGINT; txFace: LONGINT): LONGINT; C;
  203. FUNCTION GXGetConvertQDFont: gxConvertQDFontUPP; C;
  204. PROCEDURE GXSetConvertQDFont(userFunction: gxConvertQDFontUPP); C;
  205. {  ColorSync 2.0 interface related routines  }
  206. PROCEDURE GXSetColorProfileReference(profile: gxColorProfile; reference: CMProfileRef); C;
  207. FUNCTION GXGetColorProfileReference(profile: gxColorProfile): CMProfileRef; C;
  208.  
  209. {$ALIGN RESET}
  210. {$POP}
  211.  
  212. {$SETC UsingIncludes := GXEnvironmentIncludes}
  213.  
  214. {$ENDC} {__GXENVIRONMENT__}
  215.  
  216. {$IFC NOT UsingIncludes}
  217.  END.
  218. {$ENDC}
  219.